Skip to content

Allow setSettings/setGlobalSettings to accept updater callbacks#135

Open
fhollermayer wants to merge 2 commits intoelgatosf:mainfrom
fhollermayer:feature/settings-via-callback
Open

Allow setSettings/setGlobalSettings to accept updater callbacks#135
fhollermayer wants to merge 2 commits intoelgatosf:mainfrom
fhollermayer:feature/settings-via-callback

Conversation

@fhollermayer
Copy link
Contributor

This change extends the existing functionality of Action.setSettings and settings.setGlobalSettings by adding overloads that accept a callback function instead of a static object. The callback receives the current settings and returns the updated settings, allowing updates to be expressed relative to the existing state. As a result, these setter functions can be used without explicitly calling the corresponding retrieval methods.

settings.setGlobalSettings(v => ({
  ...v,
  foobar: "123",
}));

or

action.setSettings(v => {
  v.foobar = "123";
  return v;
});

This PR is intended as a compilable proposal rather than a change request—feel free to discard it if it’s not a good fit.

@fhollermayer fhollermayer force-pushed the feature/settings-via-callback branch from fbe479b to 1226495 Compare January 8, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant